<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of settings_model
 *
 * @author souzadavi
 */
class Pagamento_model extends CI_Model {

    //put your code here

    public function __construct() {
        parent::__construct();
        $this->load->config('parametros');
    }

     public function get_categoria($_categoria) {
        $this->db->select('c.*');

        $this->db->join($this->config->item('dbCliente') . $this->config->item('tblConfiguracaoCat') . ' AS cc', 'c.id_cat = cc.id_cat', 'INNER');
        
        $this->db->where('cc.nome', $_categoria);
        $this->db->where('c.users_id', $this->tank_auth->get_user_id());
        
        $query = $this->db->get($this->config->item('dbCliente') . $this->config->item('tblConfiguracao') . ' AS c');
        
        //pre($this->db->last_query());
        
        if ($query->num_rows() > 0) {
            return $query->result();
        } else {
            return null;
        }
    }

}

?>
